Skip to content

[#822] Replace dual-render with CSS grid-template-areas#825

Merged
realproject7 merged 2 commits intomainfrom
task/822-header-single-render
Apr 4, 2026
Merged

[#822] Replace dual-render with CSS grid-template-areas#825
realproject7 merged 2 commits intomainfrom
task/822-header-single-render

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • Replaced hidden sm:block + sm:hidden dual-render pattern with CSS grid-template-areas
  • Stats grid and CTA button now rendered once in the DOM instead of twice
  • Mobile: stats span full width below cover+info row ('cover info' / 'stats stats')
  • Desktop: stats align with info column only ('cover info' / '. stats')
  • MarketCapBox and DeadlineCountdown now mount once (no duplicate API calls/timers)
  • No visual changes on any breakpoint

Test plan

  • Desktop: stats grid + CTA next to cover in right column
  • Mobile: stats grid full-width below cover+info row
  • Mobile: CTA button full-width
  • Desktop: CTA button inline/auto-width
  • Inspect DOM: stats grid and CTA appear only once
  • Verify MarketCapBox network calls fire once (not twice)

Fixes #822

🤖 Generated with Claude Code

…e-areas

Stats grid and CTA button were rendered twice in DOM (hidden sm:block +
sm:hidden), causing MarketCapBox and DeadlineCountdown to mount twice
with duplicate API calls and timers. Now rendered once and repositioned
via grid-template-areas for mobile vs desktop layout.

Fixes #822

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plotlink Ignored Ignored Apr 4, 2026 5:21am

Request Review

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Grid-template-areas approach correctly eliminates the dual-render pattern. Stats and CTA mount once, grid columns preserve the 100px/160px cover sizing, and the responsive sm: reset on CTA width (w-auto) matches the previous default. No visual or logic regressions.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The single-render grid approach is the right fix for issue #822, but this version introduces a layout regression when priceInfo is missing.

Findings

  • [medium] The new stats grid item is always rendered with mt-4 sm:mt-6, even when both statsGrid and AddPlotButton render nothing. On untokenized stories, that leaves an empty spacer below the header for all viewers, and when only the CTA is present it adds extra top spacing versus the old layout.
    • File: src/app/story/[storylineId]/page.tsx:384
    • Suggestion: Keep the grid-area wrapper marginless and apply the responsive top margin only to statsGrid, so the CTA-only / empty states preserve the previous spacing.

Decision

Requesting changes because the issue requires no visual regressions, and this change alters the header spacing for stories without price data.

Fixes empty vertical space on untokenized stories where priceInfo is
null and AddPlotButton renders null.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The follow-up commit fixes the header spacing regression from the earlier review while preserving the single-render grid-template-areas solution for issue #822.

Findings

  • None. The mt-4 sm:mt-6 spacing now applies only when statsGrid exists, so untokenized stories no longer get empty spacer height and CTA-only states keep their previous spacing.

Decision

Approving because the PR now meets the acceptance criteria: stats and CTA render once in the DOM, side effects mount once, and the prior visual regression is resolved.

@realproject7 realproject7 merged commit 5fc0a0e into main Apr 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Storyline header: stats grid rendered twice in DOM (hidden/block duplication)

2 participants